<?php
if(isset($_POST['submit'])){
	$aQueriesSubmitted = explode(';', $_POST['queries']);

	displayContentArray('$aQueriesSubmitted', $aQueriesSubmitted);

	$oMysqliInstance = AYSMysqli::getInstance();
	foreach($aQueriesSubmitted AS $query){
		if(!empty($query)){
			$rQueryResult = $oMysqliInstance->query($query);
			echo '<p>'.$query.'<br />Execution de la requête réalisée sans encombre.';
			if(strstr('SELECT', $query) !== null){
				print_r($rQueryResult);
				echo '<br />Résultat :';
				while($aimSelectRow = $rQueryResult->fetch_assoc()){
					displayContentArray('', $aimSelectRow);
				}
			}
			echo '</p>';
		}
	}
}
require_once VIEW_DIR.'/panelSql.php';